<?php
require_once("db/config.php");
header("Content-Type:text/html;charset=utf-8");
session_start();

//清除session
$username=$_SESSION['username'];
$_SESSION=array();
session_destroy();


$sql = "delete from message where user='$username'";
$result=mysqli_query($con, $sql);//执行语句
//清除cookie
setcookie("username", '', time()-1);
setcookie("code", '', time()-1);
echo "$username,欢迎下次光临";
echo "重新<a href='login.php'>登录</a>";
?> 